package com.likuicat.picture_ddd.domain.user.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.likuicat.picture_ddd.domain.user.entity.User;
import com.likuicat.picture_ddd.interfaces.dto.user.UserQueryRequest;
import com.likuicat.picture_ddd.interfaces.vo.user.LoginUserVO;
import com.likuicat.picture_ddd.interfaces.vo.user.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Set;

/**
* @author fc3379757631
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2025-05-04 15:13:06
*/
public interface UserDomainService{

    /**
     * 用户注册
     * @param userAccount
     * @param password
     * @param checkPassword
     * @return
     */
    long userRegister(String userAccount, String password,String checkPassword);

    /**
     * 用户登录
     * @param userAccount
     * @param password
     * @param request
     * @return
     */
    LoginUserVO userLogin(String userAccount, String password, HttpServletRequest request);

    /**
     * 获取当前登录用户
     * @param request
     * @return
     */
    User getLoginUser(HttpServletRequest request);

    /**
     * 用户注销
     * @param request
     * @return
     */
    boolean userLogout(HttpServletRequest request);

    /**
     * 加密密码
     * @param password
     * @return
     */
    String getEncryptPassword(String password);

    /**
     * 返回脱敏用户LoginUserVO
     * @param user
     * @return
     */
    LoginUserVO getUserToLoginUserVO(User user);

    /**
     * 返回脱敏用户UserVO
     * @param user
     * @return
     */
    UserVO getUserToUserVO(User user);

    /**
     * 返回脱敏UserVO集合类
     * @param userList
     * @return
     */
    List<UserVO> getUserVOList(List<User> userList);

    /**
     * 将查询请求转化为QueryWrapper
     * @param userQueryRequest
     * @return
     */
    QueryWrapper<User> getUserQueryWrapper(UserQueryRequest userQueryRequest);

    Boolean removeById(Long id);

    boolean updateById(User user);

    User getById(long id);

    Page<User> page(Page<User> userPage, QueryWrapper<User> queryWrapper);

    List<User> listByIds(Set<Long> userIdSet);

    boolean save(User user);
}
